<template>
  <div>
    <!-- 这里是头部的数据 -->
    <el-breadcrumb separator-class="el-icon-arrow-right">
      <el-breadcrumb-item
        :to="{ name: item.name }"
        v-for="(item, index) in listPath"
        :key="index"
        >{{ item.title }}</el-breadcrumb-item
      >
    </el-breadcrumb>
  </div>
</template>

<script lang="ts">
import { Component, Vue } from "vue-property-decorator";
import { HeadModule } from "@/store/modules/HeadModule";
import { isEqual } from "lodash";

@Component({ name: "MyHeader" })
export default class MyHeader extends Vue {
  get listPath() {
    let tempList: any = [...HeadModule.listPathHeader];
    const len = tempList.length;

    if (len > 3) {
      // 其它的元素都需要转化
      tempList = [
        {
          name: "",
          title: "..."
        },
        tempList[len - 3],
        tempList[len - 2],
        tempList[len - 1]
      ];
    }

    return tempList;
  }
}
</script>

<style></style>
